package zhuhai
{
	import flash.events.Event;
	import flash.text.TextField;
	import flash.display.Sprite;
	public class Header extends Sprite
	{
		private var title:String;
		public function Header(s:String)
		{//头部标题
			title = s;
			addEventListener(Event.ADDED_TO_STAGE,init);
		}
		public function setTitle(s:String):void
		{//设置标题文字
			title = s;
			txt.text = title;
		}
		private var txt:TextField ;
		private function init(e:Event):void
		{
			var h:int = 50;
			with(graphics)
			{
				clear();
				beginFill(0x0);
				drawRect(0,0,Main.stageWidth,h*1.2);
				endFill();
			}
			if(txt==null){
				txt = ViewSet.makeTxtLine(title,h,0xffffff);
			}
			addChild(txt);
		}
	}
}
